public class Convert {
    // 二叉搜索树与双向链表
    // https://www.nowcoder.com/practice/947f6eb80d944a84850b0538bf0ec3a5?tpId=295&tags=&title=&difficulty=0&judgeStatus=0&rp=0&sourceUrl=%2Fexam%2Foj%3Fpage%3D1%26tab%3DSQL%25E7%25AF%2587%26topicId%3D295
    private TreeNode prev;
    public TreeNode Convert(TreeNode pRootOfTree) {
        if (pRootOfTree == null) {
            return pRootOfTree;
        }
        TreeNode leftNode = Convert(pRootOfTree.left);
        if (prev != null) {
            prev.right = pRootOfTree;
        }
        pRootOfTree.left = prev;
        prev = pRootOfTree;
        Convert(pRootOfTree.right);
        return leftNode == null ? pRootOfTree : leftNode;
    }
}
